<?php


namespace App\Transformers\Live;


use App\Models\LiveAnchor;
use App\Models\OtherOrderStatus;
use League\Fractal\TransformerAbstract;

class OtherOrderStatusTransformer extends TransformerAbstract
{
    public function transform(OtherOrderStatus $data)
    {
        return [
            'id' => $data->id,
            'change_type' => $data->change_type ?? "",
            'change_mark' => $data->change_mark ?? "",
            'order_id' => $data->order_id ?? "",
            'shop_type' => $data->shop_type ?? 0,
            'operate_man' => $data->operate_man ?? "",
            'operate_man_text' => $data->operateManEnum[$data->operate_man] ?? "",
            'order_status' => $data->order_status ?? "",
            'order_status_text' => $data->orderStatusEnum[$data->order_status] ?? "",
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }

}
